/**
 * 自定义组件 父级组件向子级组件传参
 */
var alertComponent =  {
    template: '#alertTpl',
    props: ['msg'],
    methods: {
        onClick : function(){
            alert(this.msg)
        }
    }
}

var aComponent =  {
    template: '#aTpl',
    props: ['username']
}
var app = new Vue({
    el : "#app",
    components :{
        alert : alertComponent,
        user : aComponent
    }
})